import 'package:flutter/material.dart';

class SliderDemo extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => SliderDemoState();
}

class SliderDemoState extends State<SliderDemo> {
  double _sliderValue = 0.0;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('SliderDemo'),
        elevation: 0.0,
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          Text('slider value = $_sliderValue'),
          Slider(
              activeColor: Colors.blue,
              min: 0.0,
              max: 100.0,
              divisions: 100,
              label: '${_sliderValue.toInt()}',
              inactiveColor: Colors.grey,
              value: _sliderValue,
              onChanged: (value) {
                setState(() {
                  _sliderValue = value;
                });
              })
        ],
      ),
    );
  }
}
